** regulation by place

set trace off
set more 1 
capture log close
clear
clear matrix
set mem 31g
set matsize 11000
set maxvar 32767
set linesize 200
version 9

log using wharton.log, replace


use "WHARTON LAND REGULATION DATA_1_24_2008.dta", clear
drop state
gen state = 2 if statename=="AK"
replace state = 1 if statename=="AL" 
replace state = 05 if statename=="AR"                      
replace state = 60 if statename=="AS"            
replace state = 04 if statename=="AZ"            
replace state = 06 if statename=="CA"            
replace state = 08 if statename=="CO"            
replace state = 09 if statename=="CT"            
replace state = 11 if statename=="DC"            
replace state = 10 if statename=="DE"            
replace state = 12 if statename=="FL"            
replace state = 13 if statename=="GA"            
replace state = 66 if statename=="GU"            
replace state = 15 if statename=="HI"            
replace state = 19 if statename=="IA"            
replace state = 16 if statename=="ID"            
replace state = 17 if statename=="IL"            
replace state = 18 if statename=="IN"            
replace state = 20 if statename=="KS"            
replace state = 21 if statename=="KY"            
replace state = 22 if statename=="LA"            
replace state = 25 if statename=="MA"            
replace state = 24 if statename=="MD"            
replace state = 23 if statename=="ME"            
replace state = 26 if statename=="MI"            
replace state = 27 if statename=="MN"            
replace state = 29 if statename=="MO"            
replace state = 28 if statename=="MS"            
replace state = 30 if statename=="MT"            
replace state = 37 if statename=="NC"            
replace state = 38 if statename=="ND"            
replace state = 31 if statename=="NE"            
replace state = 33 if statename=="NH"            
replace state = 34 if statename=="NJ"            
replace state = 35 if statename=="NM"            
replace state = 32 if statename=="NV"            
replace state = 36 if statename=="NY"            
replace state = 39 if statename=="OH"            
replace state = 40 if statename=="OK"            
replace state = 41 if statename=="OR"            
replace state = 42 if statename=="PA"            
replace state = 72 if statename=="PR"            
replace state = 44 if statename=="RI"            
replace state = 45 if statename=="SC"            
replace state = 46 if statename=="SD"            
replace state = 47 if statename=="TN"            
replace state = 48 if statename=="TX"            
replace state = 49 if statename=="UT"            
replace state = 51 if statename=="VA"            
replace state = 78 if statename=="VI"            
replace state = 50 if statename=="VT"            
replace state = 53 if statename=="WA"            
replace state = 55 if statename=="WI"            
replace state = 54 if statename=="WV"            
replace state = 56 if statename=="WY"         

tab statename if state==.
rename ufips placefp
collapse (mean) wharton=WRLURI [w=weight], by(state placefp)
sum wharton, det
sort state placefp
save wharton, replace
